/**
 * 
 */
$(document).ready(function() {
	
	
	$.ajax({
		url : "/KettleMVC/Test/GetAllJobs",
		type : "POST",
		dataType : "json",
		contentType : "application/json;charset=UTF-8",
		success : function(ret) {
			console.log(ret);

			$("#jobTable").html("");
			var innerHtml = "";
			for (var i = 0; i < ret.length; i++) {
				innerHtml += "<tr>";
				innerHtml += "<td>" + ret[i].idJob + "</td>" + "<td>"
						+ ret[i].name + "</td>";
				innerHtml += "</tr>";
			}
			$("#jobTable").append(innerHtml);
		},
		error : function(ret) {
			console.log(ret);
		}
	})

	$("#execJobBtn").click(function() {
		AjaxInvoke("/KettleMVC/Test/ExecJobById", {parJobID : 2}, "POST", function(ret) {
			if(ret.Result)
			{
				alert("111");
			}
			else {
				alert(ret.Message);
			}
		}, true);
	})
})